<%--
  Created by IntelliJ IDEA.
  User: xuweijie
  Date: 17-5-8
  Time: 下午4:51
  To change this template use File | Settings | File Templates.
--%>
<%@ include file="/WEB-INF/views/include/header.jsp"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>全部用户</legend>
</fieldset>
<table class="layui-table" lay-even="" lay-skin="row">
    <colgroup>
        <col width="80">
        <col width="250">
        <col width="150">
        <col width="150">
        <col width="150">
        <col width="200">
    </colgroup>
    <thead>
    <tr>
        <th>序号</th>
        <th>用户名</th>
        <th>角色</th>
        <th>头像</th>
        <th>性别</th>
        <th>电话</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:set var="i" value="${0}" />
    <c:forEach items="${users}" var="user">
        <tr>
            <c:set var="i" value="${i+1}" />
            <td>${i}</td>
            <td>${user.username}</td>
            <td>${user.croRole.rolename}</td>
            <td><img src="${user.photo}" width="32" height="32"></td>
            <td>${user.sex}</td>
            <td>${user.phone}</td>
            <td><a data-method="update" userid="${user.id}" rolename="${user.croRole.rolename}" sex="${user.sex}" class="layui-btn layui-btn-small layui-btn-normal updateuser"><i class="layui-icon"></i></a>
                &nbsp;&nbsp;
            <a data-method="notice" userid="${user.id}" class="layui-btn layui-btn-small layui-btn-danger deluser"><i class="layui-icon"></i></a></td>
        </tr>
    </c:forEach>
    </tbody>
</table>

<%--更新弹出框样式--%>
<form id="userupdatemodel" class="layui-form" hidden>
    <br>
    <div class="layui-form-item">
        <label class="layui-form-label">账号</label>
        <div class="layui-input-block">
            <input disabled type="text" id="upusername" name="upusername"  required  lay-verify="required" placeholder="请输入用户账号" autocomplete="off" class="layui-input" style="width: 95%">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">新密码</label>
        <div class="layui-input-block">
            <input type="password" id="uppassword" name="uppassword" value=""  placeholder="请输入新密码" autocomplete="off" class="layui-input" style="width: 95%">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">联系电话</label>
        <div class="layui-input-block">
            <input type="text" id="upphone" name="upphone" required  lay-verify="required" placeholder="请输入联系方式" autocomplete="off" class="layui-input" style="width: 95%">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">角色</label>
        <div class="layui-input-block" id="radio_role">
            <c:forEach items="${croRoles}" var="role">
                <input type="radio" id="uproleid" name="uproleid" value="${role.id}" title="${role.rolename}">
            </c:forEach>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">性别</label>
        <div class="layui-input-block" id="radio_sex">
            <input type="radio" id="upsex" name="upsex" value="男" title="男">
            <input type="radio" id="upmsex" name="upsex" value="女" title="女" >
        </div>
    </div>
</form>
